package br.com.rankingme.client;

import java.io.IOException;

import org.restlet.data.Form;
import org.restlet.resource.ClientResource;

import br.com.rankingme.resource.usuario.IUsuarioResource;
import br.com.rankingme.resource.usuario.UsuarioResource;

public class ClienteUsuario {
	
	protected static void salvaUsuario() throws IOException {
		IUsuarioResource usuarioResource = new 
			UsuarioResource();//"http://localhost:8080/usuarios");
		
		Form form1 = new Form();
		form1.add("nome", "Thiago Arrombado");
		form1.add("login", "thiagoarrombado");
		form1.add("email", "thiagoarrombado@gmail.com");
		form1.add("senha", "teste");
		
		/*Representation put1 = */usuarioResource.salvar(
				form1.getWebRepresentation()
		);
		//System.out.println(put1.getText());
	}
	
	public static void main(String[] args) {
		ClientResource client = 
			new ClientResource("http://127.0.0.1:8080/rankingme/usuario");
		
		Form form1 = new Form();
		form1.add("nome", "Thiago Arrombado");
		form1.add("login", "thiagoarrombado");
		form1.add("email", "thiagoarrombado@gmail.com");
		form1.add("senha", "teste");
		
		/*Representation put1 = */client.put(
				form1.getWebRepresentation()
		);
	}

}
